package com.aerozhonghuan.logisticsmall.framework.hybrid.actions;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.View;

import com.aerozhonghuan.logisticsmall.framework.base.TitlebarActivity;
import com.aerozhonghuan.logisticsmall.framework.hybrid.NewWebviewFragment;
import com.aerozhonghuan.logisticsmall.framework.hybrid.SimpleActionHandler;
import com.aerozhonghuan.logisticsmall.framework.hybrid.bean.JsMobileAgentConstants;
import com.aerozhonghuan.hybrid.XJsCallback;

import org.json.JSONObject;

/**
 * 描述
 * 作者 Zhang Yonghui
 * 创建日期 2019/1/21
 */

public class ShowNavBarActionHandler extends SimpleActionHandler {

    public ShowNavBarActionHandler(NewWebviewFragment fragment) {
        super(JsMobileAgentConstants.FLAG_HIDE_NAVBAR, fragment);
    }

    @Override
    public void handleAction(@NonNull String action, @Nullable JSONObject params, @Nullable XJsCallback callBack) {
        if (getActivity() instanceof TitlebarActivity) {
            ((TitlebarActivity)getActivity()).getTitleBarView().setVisibility(View.VISIBLE);
        }
    }
}
